package com.example.scaffold.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.scaffold.common.bean.PageResult;
import com.example.scaffold.order.bean.OrderDTO;
import com.example.scaffold.order.bean.OrderEditParam;
import com.example.scaffold.order.bean.OrderQueryParam;
import com.example.scaffold.order.bean.OrderVO;
import com.example.scaffold.order.entity.Order;

/**
 * 订单服务接口
 * 遵循阿里手册：服务层命名规范，接口设计规范
 *
 * @author example
 */
public interface OrderService extends IService<Order> {

    /**
     * 根据ID查询订单
     *
     * @param id 订单ID
     * @return 订单信息
     */
    OrderDTO getOrderById(Long id);

    /**
     * 创建订单
     *
     * @param param 订单信息
     * @return 订单ID
     */
    Long createOrder(OrderEditParam param);

    /**
     * 更新订单
     *
     * @param id      订单ID
     * @param param 订单信息
     * @return 是否成功
     */
    boolean updateOrder(Long id, OrderEditParam param);

    /**
     * 删除订单
     *
     * @param id 订单ID
     * @return 是否成功
     */
    boolean deleteOrder(Long id);

    /**
     * 根据属性查询订单
     * @param param
     * @return
     */
    PageResult<OrderVO> listOrder(OrderQueryParam param);
}